Carbon


HSetFLock

Header: Files.h Carbon status: Supported

Locks a file.

OSErr HSetFLock (
    SInt16 vRefNum, 
    SInt32 dirID, 
    ConstStr255Param fileName
);
Parameter descriptions
vRefNum

A volume reference number, a working directory reference number, or 0 for the default volume.

dirID

A directory ID.

fileName

The name of the file.

function result

A result code.

DISCUSSION

After you lock a file, all new access paths to that file are read-only. This function has no effect on existing access paths.

If the PBHGetVolParmsSync or PBHGetVolParmsAsync function indicates that the volume supports folder locking (that is, the bHasFolderLock bit of the vMAttrib field is set), you can use HSetFLock to lock a directory.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)